package cn.tedu_01;



import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;

import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;

public class DateTest {
    public static void main(String[] args) throws ParseException {
        //method();
        //method2();
        //method3();
        //method4();
        //method5();
        //method6();
        //method7();
        //method8();
        // method9();
        method10();


    }

    private static void method10() {
        double a = new Scanner(System.in).nextDouble();
        double b  = new Scanner(System.in).nextDouble();

        BigDecimal bd1=new BigDecimal(String.valueOf(a));
        BigDecimal bd2=new BigDecimal(String.valueOf(b));

        System.out.println(bd1.add(bd2));
        System.out.println(bd1.subtract(bd2));
        System.out.println(bd1.multiply(bd2));
        System.out.println(bd1.divide(bd2,3,BigDecimal.ROUND_HALF_UP));



    }

    private static void method9() {
        double a = new Scanner(System.in).nextDouble();
        double b  = new Scanner(System.in).nextDouble();
        System.out.println(a+b);
        System.out.println(a-b);
        System.out.println(a*b);
        System.out.println(a/b);



    }

    private static void method8() {
        Integer i =new Integer(5);

        Integer c =Integer.valueOf(5);
        System.out.println(c);

        int a  = i.intValue();
        System.out.println(a);

        int b =Integer.parseInt("8");
        System.out.println(b);



    }

    private static void method7() {
        Integer i = new Integer(5);
        Integer c =Integer.valueOf(5);
        System.out.println(c);

        int a  =i.intValue();
        System.out.println(a);

        int b =Integer.parseInt("5");
        System.out.println(b);


    }

    private static void method6() {
        double a = new Scanner(System.in).nextDouble();
        double b =new Scanner(System.in).nextDouble();
        BigDecimal bd1 =new BigDecimal(String.valueOf(a));
        BigDecimal bd2 =new BigDecimal(String.valueOf(b+""));
        BigDecimal bd3 =bd1.add(bd2);
        System.out.println(bd3);
        System.out.println(bd1.subtract(bd2));
        System.out.println(bd1.multiply(bd2));
        //  bd3= bd1.divide(bd2,3,BigDecimal.ROUND_HALF_UP);
        // System.out.println(bd3);
        bd3= bd1.divide(bd2,3,BigDecimal.ROUND_HALF_UP);
        System.out.println(bd3);



    }

    private static void method5() {
        double a = new Scanner(System.in).nextDouble();
        double b  =new Scanner(System.in).nextDouble();
        System.out.println(a+b);
        System.out.println(a-b);
        System.out.println(a*b);
        System.out.println(a/b);



    }

    private static void method4() throws ParseException {
        String data =new Scanner(System.in).nextLine();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        Date birthday =sdf.parse(data);
        long start =birthday.getTime();
        Long now = System.currentTimeMillis();
        System.out.println((now-start)/1000/60/60/24);


    }

    private static void method3() throws ParseException {
        String data = new Scanner(System.in).nextLine();
        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
        Date birthday =sdf.parse(data);
        long start =birthday.getTime();
        long now = System.currentTimeMillis();
        System.out.println(now-start);
    }

    private static void method2() throws ParseException {
        String data = new Scanner(System.in).nextLine();

        SimpleDateFormat sdf =
                new SimpleDateFormat("yyyy-MM-dd");
        Date birthday = sdf.parse(data);
        long start = birthday.getTime();
        long now = System.currentTimeMillis();
        System.out.println((now-start)/1000/60/60/24);

    }

    private static void method() {
        Date d =new Date();
        System.out.println(d.getDate());
        System.out.println(d.getDay());
        System.out.println(d.getHours());
        System.out.println(d.getMinutes());
        System.out.println(d.getMonth()+1);
        System.out.println(d.getSeconds());
        System.out.println(d.getTime());
        System.out.println(d.getYear()+1900);
        System.out.println(d.toLocaleString());
    }
}
